﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DatabaseUserTest.Controller
{
    public class DestinationCTRL
    {
        private DBDestination dbDest = new DBDestination();


        public List<Destination> FindAllDestinations()
        {
            return dbDest.FindAllDestinations();
        }

        public Destination FindDestinationName(string name)
        {
            return dbDest.FindDestinationName(name);
        }

        public List<Destination> FindDestinationCountry(string country)
        {
            return dbDest.FindDestinationCountry(country);
        }

        public bool AddDestination(string name, string country)
        {
            Destination destination = new Destination();
            destination.Name = name;
            destination.Country = country;

            dbDest.AddDestination(destination);

            if (dbDest.FindDestinationName(destination.Name) != null)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

    }
}
